home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / utility / pock51.zip / DEMO.BAT < prev    next >
DOS Batch File  |  1997-07-26  |  14KB  |  474 lines

  1. echo off
  2. cls
  3. d    /Yny// /'//@tThis is a DEMO for the program D.EXE (&WPocketD&w)//@tDo you want to proceed (Y@/N) ?'
  4. if not errorlevel 2 goto fin
  5. echo  This demonstration shows a small sample of D.EXE's features. The user is
  6. echo  advised to run MENUD.EXE for a complete interactive demonstration of the
  7. echo  full range of features, and to run README for illustrative examples.
  8. echo.
  9. echo  All files other than the original PocketD release files will be ignored.
  10. echo  D.EXE's internal screen size is set to 80 cols by 11 rows for demonstration
  11. echo  purposes. ( The menus below are all directly controlled by D.EXE ).
  12. set d_opt2=/#80,11p:.d.exe /:.d.exe/- wh* .pcx
  13. set _=1
  14. if "%_%"=="1" goto envok
  15. echo Not enough environment space!
  16. goto fin1
  17. :envok
  18. d    /@n
  19. if errorlevel 21 goto main2
  20. echo Sorry! Demo requires full installation!
  21. goto fin1
  22.  
  23. :main
  24. cls
  25. echo Returning to main menu..
  26. :main2
  27. d    /Y_12345 /'//@t1. Directory formats/@t2. Template/@t3. File information/@t4. File selection/@t5. Help//@tESC exit//@t?'
  28. if errorlevel 6 goto help
  29. if errorlevel 5 goto select
  30. if errorlevel 4 goto stats
  31. if errorlevel 3 goto templ
  32. if errorlevel 2 goto disp
  33. goto exit
  34.  
  35. :disp
  36. cls
  37. d    /Y1234 /'//@tChoose://@t1. Normal,@/w,@/m and @/t format/@t2. Bestfit/@t3. Subdir summary/@t4. Tailoring//@tESC cancel//@t?'
  38. cls
  39. if errorlevel 4 goto tail
  40. if errorlevel 3 goto subdir
  41. if errorlevel 2 goto bestfit
  42. if errorlevel 1 goto wmt
  43. goto main
  44.  
  45. :wmt
  46. echo This is the default format: standard details sorted by file/dir name
  47. echo (Under Win95 this will give just 1 column and show long filenames on
  48. echo the right-hand of the display).
  49. echo.
  50. echo     D
  51. echo.
  52. d    /2K.24
  53. echo.
  54. pause
  55. cls
  56. echo This is the /w "wide" format giving only filename and size in KBytes
  57. echo.
  58. echo     D /w
  59. echo.
  60. d    /w
  61. echo.
  62. pause
  63. cls
  64. echo This is the /m "minimum" format giving only the filename
  65. echo.
  66. echo     D /m
  67. echo.
  68. d    /m
  69. echo.
  70. pause
  71. cls
  72. echo This is the /t "tiny" format grouping files by extension
  73. echo.
  74. echo     D /t
  75. echo.
  76. d    /t
  77. echo.
  78. pause
  79. goto disp
  80.  
  81. :bestfit
  82. echo This is the "Best-fit" format which automatically chooses the display format.
  83. echo In this case /w format is chosen to fit the 80x11 format used by the demo.    
  84. echo.
  85. echo     D /b
  86. echo.
  87. d    /b~.20
  88. echo.
  89. pause
  90. cls
  91. echo This can be modified by "column optimise" (/.k) to limit the No. of columns.
  92. echo In this case the layout is altered to 3 columns which still fits inside 11 rows.
  93. echo.
  94. echo      D /b/.k
  95. echo.
  96. d    /b~.20/.k
  97. echo.
  98. pause
  99. goto disp
  100.  
  101. :subdir
  102. echo This demonstrates some of the subdirectory summary features of PocketD
  103. d    /Yny// /'/This will require creation of temporary subdirectories with files/copied into them. Ok ?'
  104. if not errorlevel 2 goto disp
  105. echo      D N*.BAT D*.BAT /cc ATEMP1         ( command used for copy/create )
  106. echo.
  107. d    n*.bat d*.bat /cc atemp1 
  108. echo.
  109. md atemp2
  110. echo Subdirs ATEMP1 and ATEMP2 created
  111. echo.
  112. pause
  113. cls
  114. echo The following uses /r to include a summary of the contents of subdir ATEMP1
  115. echo and ATEMP2 (restricting summary to just BAT files)
  116. echo.
  117. echo     D /r .bat
  118. echo.
  119. d    /hr2K.28 .bat
  120. echo.
  121. pause
  122. cls
  123. echo The following uses /S and /G to group contents of subdirs (with /w format)
  124. echo.
  125. echo     D /wSG .bat
  126. echo.
  127. d    .\AT* /hwSG~.35+ .bat
  128. echo.
  129. pause
  130. cls
  131. d    /Y// /'//Deleting temporary files.'
  132. echo     D  atemp1 atemp2 /zd        ( command used to delete )
  133. echo.
  134. d    atemp1 atemp2 /Ihzd
  135. echo.
  136. pause
  137. goto disp
  138.  
  139. :tail
  140. echo PocketD offers 19 tailoring options. The following shows four of these:
  141. echo.
  142. echo 1. Unbroken names   2. 1jan91 date format   3. Lowercase   4. Sorting by row
  143. echo.
  144. echo     D /.umlr
  145. echo.
  146. d    /.umlr/2~.28
  147. echo.
  148. pause
  149. goto disp
  150.  
  151. :templ
  152. cls
  153. echo PocketD has a very powerful TEMPLATE facility that can be used for display
  154. echo or execution purposes. It can accept 50 possible parameters, a few shown below.
  155. d    /Y12// /'//@tChoose://@t1. Display output/@t2. Execution//@tESC cancel//@t?'
  156. cls
  157. if errorlevel 2 goto t_exec
  158. if errorlevel 1 goto t_disp
  159. goto main
  160.  
  161. :t_disp
  162. echo The display template can be used in many ways. The simple example at the
  163. echo bottom of the screen simply outputs an X for each matching file/dir.
  164. echo.
  165. echo     D /w
  166. echo.
  167. d    /w
  168. echo.
  169. echo     D [X]
  170. echo.
  171. d    [X]
  172. echo.
  173. pause
  174. cls
  175. echo The template can accept parameters such as $f giving the filename
  176. echo.
  177. echo     D [$f ]
  178. echo.
  179. d    [$f ]
  180. echo.
  181. echo.
  182. echo It can also accept formatted field widths e.g. $16f for padding to width 16
  183. echo.
  184. echo     D [$16f]
  185. echo.
  186. d    [$16f]
  187. echo.
  188. pause
  189. cls
  190. echo $10n gives only the name part without the extension, padded to width 10:
  191. echo.
  192. echo    D [$10n]
  193. echo.
  194. d    [$10n]
  195. echo.
  196. echo.
  197. echo "//" in the template will add a newline:
  198. echo.
  199. echo     D ?????.* [$10n//]
  200. echo.
  201. d    ?????.* [$10n//]
  202. echo.
  203. pause
  204. goto templ
  205.  
  206. :t_exec
  207. echo PocketD can be used to run a template for a selected group of files. For
  208. echo example, the following could be used to move each file extension group to
  209. echo its own archive file. The $e option gives the extension part of the name.
  210. echo (R? below causes PocketD to echo each line without running it. R runs).
  211. echo.
  212. echo     D /e [PKZIP -m $e *.$e]R?
  213. echo.
  214. d    /e [PKZIP -m $e *.$e]R?
  215. echo.
  216. pause
  217. cls
  218. echo PocketD can run multi-line sequences. e.g. To move each file extension
  219. echo group to its own subdir, named by the extension:
  220. echo.
  221. echo     D /e [md $e//copy *.$e $e]R?
  222. D    /e [md $e//copy *.$e $e]R?!E- *.d* *.g* .reg
  223. echo.
  224. pause
  225. cls
  226. echo PocketD can use separate templates for display and execution. This allows
  227. echo the user to browse the display template as a scrolling menu. In the example
  228. echo below $3# provides a file number, $F number of files, $d date, $t time, $s
  229. echo size. The 2nd template starts with [? indicating that it is a display template.
  230. echo The "((" template divider provides a section to appear for the 1st match only.
  231. echo The "Q" option turns the template into a menu (also allowing file viewing etc.).    
  232. echo    D [pkzip -m save $w][?  Choose from://(($3# of $F: $d $t $7s $13w Archive?]RQ
  233. echo.
  234. d    [  Choose from://(($3# of $F: $d $t $7s $13w Archive?]?~.10
  235. echo.
  236. pause
  237. cls
  238. echo PocketD can run alternative templates to give the user the choice of tasks.
  239. echo The example below allows the user to either move a file to an archive AND/OR
  240. echo copy it to drive A:. The user types "1" to execute the 1st template and "2"
  241. echo for the 2nd. This example could have used 2 display templates, giving 4 in all.    
  242. echo  D [pkzip -m save $w][copy $w A:][? $15w (1) Move to Archive (2) Copy to A:]QR
  243. echo.
  244.  
  245. D    [ $15w (1) Move to Archive (2) Copy to A:]?~.10
  246. echo.
  247. echo From this it can be seen that PocketD's templates potentially offer the user a
  248. echo great deal of power for file management. The user is recommended to follow
  249. echo the detailed examples given in the on-line guide, accessed by typing D /??
  250. pause
  251. goto templ
  252.  
  253. :stats
  254. cls
  255. echo PocketD can provide additional information about files and present file
  256. echo data in a number of ways. The following gives a few examples of this.
  257. d    /Y123// /'//@tChoose://@t1. Barchart display/@t2. Execution size and Compression/@t3. Extension summary//@tESC cancel//@t?'
  258. cls
  259. if errorlevel 3 goto exten
  260. if errorlevel 2 goto exec
  261. if errorlevel 1 goto bar
  262. goto main
  263.  
  264. :bar
  265. echo The following chart show the relative size of all files represented as a
  266. echo bar chart. (only 1st 14 files shown).
  267. echo.
  268. echo     D /g
  269. echo.
  270. d    /gK.12- b* g* .doc .lst .frm
  271. echo.
  272. pause
  273. cls
  274. echo The chart is improved by sorting the files by size (ss) & showing the relative
  275. echo percentage usage of each (%%). It also shows the size in terms of space used
  276. echo rather than actual size (U). If /r were added (and subdirectories were present)
  277. echo then the relative sizes of the subdirectories would be plotted.
  278. echo.
  279. echo     D /ss /%%U /g       (or D /ss/%Ug- *.BAT etc..)
  280. echo.
  281. d    /ss/%%UgK.11- b* g* .doc .lst .frm
  282. echo.
  283. pause
  284. goto stats
  285.  
  286. :exec
  287. echo PocketD can show the minimum run size of an EXE program in KBytes using /M.
  288. echo Executable files can be compressed by PKLITE, DIET, COMPACK and LZEXE. The
  289. echo /C option shows which files are compressed by flagging as p,d,c or l
  290. echo.
  291. echo     D /EMC            ( E=executable  M=exec size  C=Compress check )
  292. echo.
  293. d    /EMC
  294. echo.
  295. pause
  296. goto stats
  297.  
  298. :exten
  299. echo PocketD can summarise files and subdirs by EXTENSION, allowing the user
  300. echo to assess the space used by each extension present.
  301. echo.
  302. echo    D /e
  303. echo.
  304. d    /2eh.2K.8
  305. echo.
  306. echo This could be used with other options to provide further information. e.g.
  307. echo Showing only the top 4 extensions (in terms of size) and plotting a barchart.    
  308. echo    D /eK.4g%%/ss        (K.4 = 1st 4, /ss = sort by size, g = barchart)
  309. echo.
  310. d    /eK.4g%%/ss/h.2
  311. echo.
  312. pause
  313. goto stats
  314.  
  315. :select
  316. cls
  317. echo PocketD can apply many criteria for selecting files and subdirectories.
  318. echo.
  319. d    /Y123 /'/@tChoose://@t1. Filespecs/@t2. Size/@t3. String searching//@tESC cancel//@t?'
  320. cls
  321. if errorlevel 3 goto string
  322. if errorlevel 2 goto size
  323. if errorlevel 1 goto filesp
  324. goto main
  325.  
  326. :filesp
  327. echo PocketD uses a generalised filespec system that can include and exclude names.
  328. echo The following shows all executable files in the current directory:
  329. echo.
  330. echo  D /mhE/.u       ( m=minimum  h=no header  E=executable  /.u=unbroken names )
  331. echo.
  332. d    /mhE/.u
  333. echo.
  334. echo The group of files selected can be reduced using filespecs:
  335. echo  D /mhE/.u *L*A* G*        ( Only names with an L followed later by A
  336. echo                      or starting with the letter G )
  337. echo.
  338. d    /mhE/.u *L*A* G*
  339. echo.
  340. echo The command line can also include "exclusion" filespecs:
  341. echo  D /mhE/.u *L*A* G* /- *O* ??L*        ( also excluding all names containing O
  342. echo                          or the letter L as the 3rd character)
  343. d    /mhE/.u *L*A* G* /- *O* ??L*
  344. echo.
  345. pause
  346. cls
  347. echo PocketD also allows "type" specifications in filenames, for example:
  348. echo.
  349. echo  D *=D* *=n* /hm
  350. echo.
  351. d    *=D* *=n* /hm
  352. echo.
  353. echo This uses "=D" to match any name containing a digit, and "=n" to match
  354. echo any name that contains a non-alphanumeric character (uppercase indicates 
  355. echo match, lowercase for non-match). Also supported: =A/=a match alpha/non-alpha.
  356. echo.
  357. pause
  358. goto select
  359.  
  360. :size
  361. echo PocketD can select files by size (and also date, See D /??).
  362. echo The following shows all non-executable files sorted by size:
  363. echo.
  364. echo     D /h!Ess    ( h=no header  !E=NOT executable  ss=sort by size )
  365. echo.
  366. d    /2h!Ess/K.14
  367. echo.
  368. echo A size restriction could be added to this:    
  369. echo     D /h!Ess/}20000        ( greater or equal to 20000 )
  370. echo.
  371. D    /2h!Ess/}20000
  372. echo.
  373. echo This could be replaced by a range 3k to 4k (k=Kilobytes):
  374. echo     D /h!Ess/}3k{4k
  375. echo.
  376. D    /2h!Ess/}3k{4k
  377. pause
  378. goto select
  379.  
  380. :string
  381. echo PocketD can select files by the strings they contain (m=minimum  h=no header):
  382. echo.
  383. echo     D *.BAT /mh'not'    ( only *.BAT files containing 'not' )
  384. echo.
  385. d    *.bat /mh'not' 
  386. echo.
  387. echo This can be inverted to only those not containing 'not':
  388. echo     D *.BAT /mh!'not'    ( !'not' = not including 'not' )
  389. echo.
  390. d    *.BAT /mh!'not'
  391. echo.
  392. echo Extra options can be added to show 1st match found, but no dir listing:
  393. echo     D *.BAT /mh'not'Sd    ( S = show strings  d = no directory )
  394. echo.
  395. d    *.BAT /mh'not'Sd
  396. pause
  397. cls
  398. echo The string searching facility can be used to search for types of character,
  399. echo for example: Numeric digit, Alphabetic, Alpha-numeric, space characters etc..    
  400. echo     D *R*.BAT /hm'subdir'Sd    ( files containing the string 'subdir' )
  401. echo.
  402. d    *R*.bat /hm'subdir'Sd/- d*
  403. echo.
  404. echo This could be modified to find files with 'subdir' but not 'subdirectory':
  405. echo.
  406. echo     D *R*.BAT /hm'subdir@a'Sd    ( @a = non-alphabetic character )
  407. echo.
  408. d    *R*.bat /hm'subdir@a'Sd/- d*
  409. echo.
  410. echo Other options include L/l show/don't show line numbers, * show all strings
  411. echo and "" instead of '' for case-insensitive search.
  412. echo.
  413. pause
  414. goto select
  415.  
  416. :help
  417. cls
  418. echo PocketD comes with a number of documentation files.
  419. echo This demo only gives access to the on-line help.
  420. echo.
  421. if exist *.diz echo (PocketD will prompt the user for a number between 1-4 before allowing access)
  422. echo.
  423. echo 1. The single page help, accessed by D /?
  424. echo.
  425. pause
  426. d /?
  427. pause>nul
  428. cls
  429. echo 2. The User Guide, assessed by D /??
  430. echo.
  431. pause
  432. d /??
  433. cls
  434. echo 3. The on-line manual, given for the example D /?c
  435. echo.
  436. pause
  437. d /?c
  438. goto main
  439.  
  440. :exit
  441. cls
  442. echo DEMO terminated
  443. echo.
  444. echo This demonstration has not covered the following major features:
  445. echo.
  446. echo .  The New MENUD.EXE 60-menu front-end to D.EXE. Try it!
  447. echo .  Support of Win95 long filenames and extended date/time attributes
  448. echo .  Scrolling display and execution templates (see UNARC.BAT and Q.BAT)
  449. echo .  COPY/MOVE facilities, including copy to multi-disk, conditional copy,
  450. echo    multiple sources, subtree copying and "safe" copy features.
  451. echo .  ARCHIVE viewing and searching in ZIP/ARC/ZOO/LZH/ARJ/PAK archives
  452. echo .  Using PocketD to emulate utilities such as NCD, WHICH and MAKE etc..
  453. echo .  Using the separate display and execution TEMPLATE(s) to create utilities
  454. echo    that can intelligently interact with the user.
  455. echo .  ENVIRONMENT VARIABLE analysis from command line. e.g. D :PATH
  456. echo .  FILE SEARCH across multiple drives/subdirs using multiple criteria
  457. echo .  TOUCH and full ATTRIB modification of files
  458. echo .  SETCOL on-line file colour selection
  459. echo .  ON-LINE BROWSING of file lists and the 37 USER-DEFINED parameter names
  460. echo.
  461.  
  462. echo  You are referred to the on-line guide accessed by typing D /?? for these.
  463. echo.
  464.  
  465. echo  **** Other PocketWare products!  Have a look at the new Super-compressor CRUSH
  466. echo  **** CRUSH allows the user to create archives only half the size of PKZIP!!
  467. echo.
  468.  
  469. :fin1
  470. set d_opt2=
  471. set _=
  472. if "%d_col%"=="" goto fin
  473. :fin
  474.